const jsonwebtoken = require("jsonwebtoken")
class jwt{
    static get(obj,exp=2*60*60){
        try {
            let token = jsonwebtoken.sign(obj,"asdfghjkwertyuixcvbnmdfghjty",{expiresIn:exp})
            return token
        } catch (error) {
            return false
        }
    }

    static check(token){
        try {
            let obj = jsonwebtoken.verify(token,'asdfghjkwertyuixcvbnmdfghjty')
            return obj
        } catch (error) {
            return false
        }
    }
}
module.exports=jwt